/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.master.mainkitchen;

import com.buanalintas.bynga.Controller;
import com.buanalintas.bynga.Field;
import com.buanalintas.bynga.Page;
import com.ronsicecream.pos.entities.PosMasterMainKitchen;
import java.util.List;

/**
 *
 * @author user
 */
public class MainKitchen extends Page {

    private Field mainKitchenId;
    private Field mainKitchenName;
    private Field mainKitchenAddress;
    private Field mainKitchenPhone;
    private Field mainKitchenUnitId;
    private Field mainKitchenRegionalId;
    private Field mainKitchenDescription;

    public MainKitchen() {
        super();

        setTheClass(PosMasterMainKitchen.class);




        mainKitchenId = new Field();
        mainKitchenId.setName("mainKitchenId");
        mainKitchenId.setCaption("main kitchen id");
        //mainKitchenId.setInfo("main kitchen id");
        mainKitchenId.setListProperties(" align=\"left\" width=\"1%\" nowrap");
        mainKitchenId.setInputProperties(" size=\"20\"");
        getFields().add(mainKitchenId);

//        mainKitchenRegionalId = new Field();
//        mainKitchenRegionalId.setName("mainKitchenRegionalId");
//        mainKitchenRegionalId.setCaption("regional");
//        //mainKitchenContact.setInfo("main kitchen contact");
//        mainKitchenRegionalId.setListProperties(" align=\"left\" width=\"10%\" nowrap");
//        mainKitchenRegionalId.setInputProperties(" size=\"20\"");
//        mainKitchenRegionalId.setRequired(true);
//        getFields().add(mainKitchenRegionalId);

        mainKitchenName = new Field();
        mainKitchenName.setName("mainKitchenName");
        mainKitchenName.setCaption("name");
        mainKitchenName.setRequired(true);
        mainKitchenName.setListProperties(" align=\"left\" width=\"20%\" nowrap");
        mainKitchenName.setInputProperties(" size=\"20\"");
        getFields().add(mainKitchenName);

        mainKitchenAddress = new Field();
        mainKitchenAddress.setName("mainKitchenAddress");
        mainKitchenAddress.setCaption("address");
        //mainKitchenAddress.setInfo("main kitchen address");
        mainKitchenAddress.setListProperties(" align=\"left\" width=\"30%\" nowrap");
        mainKitchenAddress.setInputProperties(" cols=\"50\" rows=\"5\"");
        mainKitchenAddress.setInputType(Field.INPUT_TEXT_AREA);
        mainKitchenAddress.setInputCase(Field.CASE_UPPER);
        mainKitchenAddress.setRequired(true);
        getFields().add(mainKitchenAddress);

        mainKitchenPhone = new Field();
        mainKitchenPhone.setName("mainKitchenPhone");
        mainKitchenPhone.setCaption("phone");
        //mainKitchenPhone.setInfo("main kitchen phone");
        mainKitchenPhone.setListProperties(" align=\"left\" width=\"5%\" nowrap");
        mainKitchenPhone.setInputProperties(" size=\"20\"");
        mainKitchenPhone.setRequired(true);
        getFields().add(mainKitchenPhone);

        mainKitchenUnitId = new Field();
        mainKitchenUnitId.setName("mainKitchenUnitId");
        mainKitchenUnitId.setCaption("unit");
        //mainKitchenEmail.setInfo("main kitchen email");
        mainKitchenUnitId.setListProperties(" align=\"left\" width=\"1%\" nowrap");
        mainKitchenUnitId.setInputProperties(" size=\"20\"");
//        mainKitchenUnitId.setRequired(true);
        getFields().add(mainKitchenUnitId);
//

//
//        mainKitchenContactPhone = new Field();
//        mainKitchenContactPhone.setName("mainKitchenContactPhone");
//        mainKitchenContactPhone.setCaption("phone");
//        //mainKitchenContactPhone.setInfo("main kitchen contact phone");
//        mainKitchenContactPhone.setListProperties(" align=\"left\" width=\"1%\" nowrap");
//        mainKitchenContactPhone.setInputProperties(" size=\"20\"");
//        mainKitchenContactPhone.setRequired(true);
//        getFields().add(mainKitchenContactPhone);
//
//        mainKitchenContactEmail = new Field();
//        mainKitchenContactEmail.setName("mainKitchenContactEmail");
//        mainKitchenContactEmail.setCaption("email");
//        //mainKitchenContactEmail.setInfo("main kitchen contact email");
//        mainKitchenContactEmail.setListProperties(" align=\"left\" width=\"1%\" nowrap");
//        mainKitchenContactEmail.setInputProperties(" size=\"20\"");
//        mainKitchenContactEmail.setRequired(true);
//        getFields().add(mainKitchenContactEmail);

        mainKitchenDescription = new Field();
        mainKitchenDescription.setName("mainKitchenDescription");
        mainKitchenDescription.setCaption("description");
        //mainKitchenDescription.setInfo("main kitchen description");
        mainKitchenDescription.setListProperties(" align=\"left\" width=\"45%\" nowrap");
        mainKitchenDescription.setInputProperties(" cols=\"50\" rows=\"5\"");
        mainKitchenDescription.setInputType(Field.INPUT_TEXT_AREA);
        mainKitchenDescription.setInputCase(Field.CASE_UPPER);
        getFields().add(mainKitchenDescription);




        fillFields();
        setExportList(getClass().getResourceAsStream("MainKitchenList.jasper"));
        setExport(getClass().getResourceAsStream("MainKitchen.jasper"));

        getFieldsAdd().remove(mainKitchenId);
        getFieldsEdit().remove(mainKitchenId);
        getFieldsList().remove(mainKitchenId);
        getFieldsView().remove(mainKitchenId);
        
//        setController(new MainKitchenController(this));
    }
//    class MainKitchenController extends Controller {
//
//        public MainKitchenController(Page page) {
//            super(page);
//            setOrder(mainKitchenName);
//            setOrderType("ASC");
//        }
//
//        @Override
//        public void beforeInsert(Object data, List list) {
//            PosMasterMainKitchen mainKitchen = (PosMasterMainKitchen) data;
//            mainKitchen.setMainKitchenUnitId(getCurrentUnit());
//        }
        
        
//    }
}
